﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FoneBuddy.LinqModel.Data;

namespace FoneBuddy.LinqModel
{
   public partial class PromotionCode
    {
         #region Variable Declaration
        private IDataRepository _dataObject;
        #endregion

        public PromotionCode(IDataRepository dataObject)
            : this()
        {
            _dataObject = dataObject;
        }
        public void Create()
        {
            _dataObject.CreatePromotionCode(this);
        }
        public void Delete()
        {
            _dataObject.DeletePromotionCode(this);
        }
        public string GeneratePromotionCode()
        {
            return
                _dataObject.GeneratePromotionCode();
        }
        //public List<PromotionCode> GetAll()
        //{
        //    return
        //    _dataObject.GetAllPromotionCode();
        //}
        public void GetPromotionCodeByCode()
        {
            _dataObject.GetPromotionCodeByCode(this);
        }
        public void UpdateUsedCount()
        {
            _dataObject.UpdateUsedCount(this);
        }
        public List<SP_GetAllPromotionCodeResult> GetAll()
        {
           return  _dataObject.GetAllPromotionCodeResult();
        }
        public void GetPromotionCodeById()
        {
             _dataObject.GetPromotionCodeById(this);
        }

    }
}
